package com.dk.service.impl;

import com.dk.mapper.TbBrandsMapper;
import com.dk.pojo.TbBrands;
import com.dk.service.TbBrandsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TbBrandsServiceImpl implements TbBrandsService {
    @Autowired
    private TbBrandsMapper brandsMapper;

    @Override
    public List<TbBrands> getBrandsList() {
        return brandsMapper.selectList(null);
    }

    @Override
    public TbBrands getBrandsById(Long id) {
        return brandsMapper.selectById(id);
    }

    @Override
    public void addBrands(TbBrands brands) {
        brandsMapper.insert(brands);
    }


    @Override
    public void deleteBrands(Long id) {
        brandsMapper.deleteById(id);
    }

    @Override
    public void updateBrandsById(TbBrands brands) {
        brandsMapper.updateById(brands);
    }
}
